package Demo1;

public class Employee extends Staff {
    public String workType;
    public int absenceDays;

    public Employee(String staffID, String staffName, char gender,
                    int seniority, double baseSalary, double maritPay, String workType, int absenceDays) {
        super(staffID, staffName, gender, seniority, baseSalary, maritPay);
        this.workType = workType;
        this.absenceDays = absenceDays;
    }

    public int attendance(){
       int attendDays=30-absenceDays;
       return attendDays;
    }
    public double getPaid(){
      double money=baseSalary+maritPay-absenceDays*100;
      return money;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "workType='" + workType + '\'' +
                ", absenceDays=" + absenceDays +
                ", staffID='" + staffID + '\'' +
                ", staffName='" + staffName + '\'' +
                ", gender=" + gender +
                ", seniority=" + seniority +
                ", baseSalary=" + baseSalary +
                ", maritPay=" + maritPay +
                '}';
    }
}
